package com.glp.work.flow.constant;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * 工单支持的状态
 *
 * @author pengjia
 * @version 2020年5月29日 下午6:50:30
 */
@Getter
public enum OrderStatus {
    /**
     * 工单状态
     */
    PROCESSING("10", "待处理"),
    PASS("20", "审批通过"),
    FAIL("30", "审批不通过"),
    REJECT("40", "审批驳回"),
    WAITNEWS("40", "等待消息"),
    PROCESSED("50", "已处理"),
    ALL("60", "全部"),
    APPROVAL("70","审批中");
    private String code;
    private String remark;

    OrderStatus(String code, String remark) {
        this.code = code;
        this.remark = remark;
    }

    public static OrderStatus getEnum(String code) {
        if (StringUtils.isNotBlank(code)) {
            for (OrderStatus os : values()) {
                if (code.equals(os.getCode())) {
                    return os;
                }
            }
        }
        return null;
    }
}
